import 'package:floor/floor.dart';

@entity
class User {
  @primaryKey
  final int? id;
  
  final String name;
  final String email;
  final int age;
  final String phone;
  final String address;
  final String city;
  final String country;
  final int salary;
  final String department;

  User({
    this.id,
    required this.name,
    required this.email,
    required this.age,
    required this.phone,
    required this.address,
    required this.city,
    required this.country,
    required this.salary,
    required this.department,
  });

  @override
  String toString() {
    return 'User{id: $id, name: $name, email: $email, age: $age, phone: $phone, address: $address, city: $city, country: $country, salary: $salary, department: $department}';
  }

  User copyWith({
    int? id,
    String? name,
    String? email,
    int? age,
    String? phone,
    String? address,
    String? city,
    String? country,
    int? salary,
    String? department,
  }) {
    return User(
      id: id ?? this.id,
      name: name ?? this.name,
      email: email ?? this.email,
      age: age ?? this.age,
      phone: phone ?? this.phone,
      address: address ?? this.address,
      city: city ?? this.city,
      country: country ?? this.country,
      salary: salary ?? this.salary,
      department: department ?? this.department,
    );
  }
}